export default function (){
  return new Promise((res,rej) => {
    window.init=function(){
      // eslint-disable-next-line no-undef
      res(BMapGL)
    }
    const scriptDOM =document.createElement('script')
    scriptDOM.type='text/javascript'
    scriptDOM.src='https://api.map.baidu.com/api?v=1.0&&type=webgl&ak=eiHMYLzoazE9ZhyZP2LeZ7vG6itetMhF&callback=init'
    scriptDOM.onerror=rej
    document.head.appendChild(scriptDOM)
  })
}
